<?php 

include './Core/function.php';

$data = include './data.php';

foreach ($data as $key => $value) {
	$result[] = $key;
}


if( $_GET && isset($_GET['id']) && in_array($_GET['id'], $result) ){
	$id = (int)$_GET['id'];

	unset($data[$id]);

	$str = var_export($data,true);
	$str = "<?php 
	return  ". $str ." 
	?>";
	file_put_contents('./data.php', $str);

	success('index.php','删除成功');

}else{
	error('index.php','非法操作');
}


 ?>